!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("rb_wixui.thunderbolt[MediaControls]",["react"],t):"object"==typeof exports?exports["rb_wixui.thunderbolt[MediaControls]"]=t(require("react")):e["rb_wixui.thunderbolt[MediaControls]"]=t(e.React)}("undefined"!=typeof self?self:this,(function(e){return function(){var t={5329:function(t){"use strict";t.exports=e},448:function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t","g"),i=(e,t)=>e.replace(n,t),l=(e,t)=>{e&&e.svgContent&&(e.svgContent=i(e.svgContent,t))};function s(e){var t,r,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;tObject.entries(e).reduce(((e,[t,r])=>(t.includes("data-")&&(e[t]=r),e)),{});const d=13,p=27;function b(e){return t=>{t.keyCode===e&&(t.preventDefault(),t.stopPropagation(),t.currentTarget.click())}}const f=b(32),v=b(d),m=e=>{v(e),f(e)},y=(b(p),(...e)=>e.map((e=>e?`wixui-${e}`:"")).join(" ")),C={root:"linkElement"},g=(e,a)=>{const{href:o,role:n,target:i,rel:l,className:s="",children:c,linkPopupId:d,anchorDataId:p,anchorCompId:b,tabIndex:y,dataTestId:g=C.root,title:x,onClick:h,onDoubleClick:k,onMouseEnter:E,onMouseLeave:M,onFocusCapture:O,onBlurCapture:S,"aria-live":j,"aria-disabled":w,"aria-label":I,"aria-labelledby":_,"aria-pressed":N,"aria-expanded":P,"aria-describedby":L,"aria-haspopup":D}=e,$=void 0!==e.activateByKey?e.activateByKey:(e=>e?"SpaceOrEnter":"Space")(d);let R;switch($){case"Enter":R=v;break;case"Space":R=f;break;case"SpaceOrEnter":R=m;break;default:R=void 0}return void 0!==o?r.createElement("a",t()({},u(e),{"data-testid":g,"data-popupid":d,"data-anchor":p,"data-anchor-comp-id":b,href:o||void 0,target:i,role:d?"button":n,rel:l,className:s,onKeyDown:R,"aria-live":j,"aria-disabled":w,"aria-label":I,"aria-labelledby":_,"aria-pressed":N,"aria-expanded":P,"aria-haspopup":D,"aria-describedby":L,title:x,onClick:h,onMouseEnter:E,onMouseLeave:M,onDoubleClick:k,onFocusCapture:O,onBlurCapture:S,ref:a,tabIndex:d?0:y}),c):r.createElement("div",t()({},u(e),{"data-testid":g,className:s,tabIndex:y,"aria-label":I,"aria-labelledby":_,"aria-haspopup":D,"aria-disabled":w,title:x,role:n,onClick:h,onDoubleClick:k,onMouseEnter:E,onMouseLeave:M,ref:a}),c)};var x=r.forwardRef(g);var h={root:"vector-image"},k="u9k3ts",E="WQ4fSJ",M="aizuI7",O="TcoJIb",S="elfY4_",j="R8rhQA";var w=e=>{const{id:a,svgContent:o,shouldScaleStroke:n,withShadow:l,withStroke:s,link:d,ariaLabel:p,ariaExpanded:b,ariaAttributes:f,className:v="",customClassNames:m=[],containerClass:C="",onClick:g,onDblClick:w,onMouseEnter:I,onMouseLeave:_,hasPlatformClickHandler:N,onKeyDown:P,toggle:L,reportBiOnClick:D,tag:$="div"}=e,R=N||g,B=!(!(T=d)||0===Object.keys(T).length&&T.constructor===Object);var T;const A=c(M,{[O]:!n,[S]:l,[j]:s,[E]:R},v),K=r.useRef(null);r.useEffect((()=>{let e;const t=K.current;return L&&(e=()=>L(!1),null==t||t.addEventListener("click",e)),()=>{e&&(null==t||t.removeEventListener("click",e))}}),[K,L]);const F=r.useMemo((()=>{if(!o)return o;const e=((e,t)=>{const r={},a=e.replace(/\sid="([^"<]+)"/g,((e,a)=>{const o=a.endsWith(t)?a:`${a}_${t}`;return r[a]=o,` id="${o}"`}));return Object.keys(r).reduce(((e,a)=>e.replace(new RegExp(`(${a})(?!_${t})`,"g"),r[a])),a)})(o,a),t=null!=f&&f.label?((e,t)=>{let r=e;const a=/aria-label="[^"]*"/;return r=e.match(a)?e.replace(a,`aria-label="${t}"`):e.replace(/(]*)>/,`$1 aria-label="${t}">`),r})(e,null==f?void 0:f.label):e;return i(t,a)}),[a,o,null==f?void 0:f.label]),H=r.createElement("div",{"data-testid":"svgRoot-"+a,className:A,dangerouslySetInnerHTML:{__html:F}}),J=(({reportBiOnClick:e,onClick:t})=>(0,r.useCallback)((r=>{e?.(r),t?.(r)}),[e,t]))({onClick:g,reportBiOnClick:D});return r.createElement($,t()({id:a},u(e),((e={})=>{const t=e.tabIndex??e.tabindex??void 0;return void 0!==t?{tabIndex:Number(t)}:{}})(e.a11y),{className:c(C,v,y(h.root,...m)),onClick:R||B?J:void 0,onDoubleClick:w,onMouseEnter:I,onMouseLeave:_,onKeyDown:P,ref:K,"aria-expanded":b}),B?r.createElement(x,t()({className:k,"aria-label":p},d),H):H)};var I=e=>r.createElement(w,t()({},e,{tag:"div"}));const _="vb-audio";var N="JtS1Rf",P="V9rZ5Z",L="TtArsF",D="ngHaxP";const $=e=>e.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase()));var R;const B={MediaControls:{component:e=>{let{id:a,translations:o,audioOnIcon:n,audioOffIcon:i,audioEnabled:s,autoplay:c,reducedMotion:u=!1}=e;const d=c&&!u;return l(n,a),l(i,a),s?r.createElement("div",{id:a,className:N,tabIndex:0,role:"button","aria-label":o.ariaLabel,"aria-pressed":d?"true":"false","data-testid":_,"data-audio-mute":""},r.createElement(I,t()({id:"audioOn-"+a,containerClass:P,className:L},n)),r.createElement(I,t()({id:"audioOff-"+a,containerClass:P,className:D},i))):r.createElement("div",{id:a})},controller:(R=e=>{let{stateValues:t,mapperProps:r}=e;const{reducedMotion:a}=t;return{...r,reducedMotion:a}},{useComponentProps:(e,t,r)=>{const a=(e=>({...e,updateStyles:t=>{const r=Object.entries(t).reduce(((e,t)=>{let[r,a]=t;return{...e,[(o=r,o.startsWith("--")?r:$(r))]:void 0===a?null:a};var o}),{});e.updateStyles(r)}}))(r);return R({mapperProps:e,stateValues:t,controllerUtils:a})}})}}}(),o}()})); //# sourceMappingURL=https://static.parastorage.com/services/editor-elements-library/dist/thunderbolt/rb_wixui.thunderbolt[MediaControls].074633b0.bundle.min.js.map